<template>
	<div class="container">
		<preview ref="previewRef" />
	</div>
</template>

<script setup>
import { ref, onMounted } from 'vue'
import Preview from '@/components/XnFilePreview/file/preview.vue'

const previewRef = ref(null)

onMounted(() => {
	const recordStr = sessionStorage.getItem("currentPreviewRecord")
	if(recordStr) {
		const record = JSON.parse(recordStr)
		// 调用 Preview 组件的 onOpen 方法进行预览
		previewRef.value.onOpen(record)
	}
})

</script>

<style scoped>
.container {
	max-width: 1200px; /* 或其他固定值 */
	margin: 0 auto;   /* 水平居中 */
}
</style>
